//
// NeL - bindings
// Copyright (C) 2010 Naush
//
//This program is free software: you can redistribute it and/or modify
//it under the terms of the GNU Affero General Public License as
//published by the Free Software Foundation, either version 3 of the
//License, or (at your option) any later version.
//
//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU Affero General Public License for more details.
//
//You should have received a copy of the GNU Affero General Public License
//along with this program.  If not, see <http://www.gnu.org/licenses/>.
package org.ryzom.nel.misc;

public class ucstring {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public ucstring(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(ucstring obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nelmiscJNI.delete_ucstring(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public ucstring() {
    this(nelmiscJNI.new_ucstring__SWIG_0(), true);
  }

  public ucstring(SWIGTYPE_p_std__basic_stringT_ucchar_t str) {
    this(nelmiscJNI.new_ucstring__SWIG_1(SWIGTYPE_p_std__basic_stringT_ucchar_t.getCPtr(str)), true);
  }

  public ucstring(String str) {
    this(nelmiscJNI.new_ucstring__SWIG_2(str), true);
  }

  public ucstring assign(SWIGTYPE_p_ucchar c) {
    return new ucstring(nelmiscJNI.ucstring_assign__SWIG_0(swigCPtr, this, SWIGTYPE_p_ucchar.getCPtr(c)), false);
  }

  public ucstring assign(String str) {
    return new ucstring(nelmiscJNI.ucstring_assign__SWIG_1(swigCPtr, this, str), false);
  }

  public ucstring assign(SWIGTYPE_p_std__basic_stringT_ucchar_t str) {
    return new ucstring(nelmiscJNI.ucstring_assign__SWIG_3(swigCPtr, this, SWIGTYPE_p_std__basic_stringT_ucchar_t.getCPtr(str)), false);
  }

  public ucstring addSelf(SWIGTYPE_p_ucchar c) {
    return new ucstring(nelmiscJNI.ucstring_addSelf__SWIG_0(swigCPtr, this, SWIGTYPE_p_ucchar.getCPtr(c)), false);
  }

  public ucstring addSelf(String str) {
    return new ucstring(nelmiscJNI.ucstring_addSelf__SWIG_1(swigCPtr, this, str), false);
  }

  public ucstring addSelf(SWIGTYPE_p_std__basic_stringT_ucchar_t str) {
    return new ucstring(nelmiscJNI.ucstring_addSelf__SWIG_3(swigCPtr, this, SWIGTYPE_p_std__basic_stringT_ucchar_t.getCPtr(str)), false);
  }

  public SWIGTYPE_p_ucchar c_str() {
    long cPtr = nelmiscJNI.ucstring_c_str(swigCPtr, this);
    return (cPtr == 0) ? null : new SWIGTYPE_p_ucchar(cPtr, false);
  }

  public void toString(SWIGTYPE_p_std__string str) {
    nelmiscJNI.ucstring_toString(swigCPtr, this, SWIGTYPE_p_std__string.getCPtr(str));
  }

  public String toString_c() {
    return nelmiscJNI.ucstring_toString_c(swigCPtr, this);
  }

  public String toUtf8() {
    return nelmiscJNI.ucstring_toUtf8(swigCPtr, this);
  }

  public ucstring substr(SWIGTYPE_p_size_type pos, SWIGTYPE_p_size_type n) {
    return new ucstring(nelmiscJNI.ucstring_substr__SWIG_0(swigCPtr, this, SWIGTYPE_p_size_type.getCPtr(pos), SWIGTYPE_p_size_type.getCPtr(n)), true);
  }

  public ucstring substr(SWIGTYPE_p_size_type pos) {
    return new ucstring(nelmiscJNI.ucstring_substr__SWIG_1(swigCPtr, this, SWIGTYPE_p_size_type.getCPtr(pos)), true);
  }

  public ucstring substr() {
    return new ucstring(nelmiscJNI.ucstring_substr__SWIG_2(swigCPtr, this), true);
  }

  public ucstring luabind_substr(SWIGTYPE_p_size_type pos, SWIGTYPE_p_size_type n) {
    return new ucstring(nelmiscJNI.ucstring_luabind_substr__SWIG_0(swigCPtr, this, SWIGTYPE_p_size_type.getCPtr(pos), SWIGTYPE_p_size_type.getCPtr(n)), true);
  }

  public ucstring luabind_substr(SWIGTYPE_p_size_type pos) {
    return new ucstring(nelmiscJNI.ucstring_luabind_substr__SWIG_1(swigCPtr, this, SWIGTYPE_p_size_type.getCPtr(pos)), true);
  }

  public ucstring luabind_substr() {
    return new ucstring(nelmiscJNI.ucstring_luabind_substr__SWIG_2(swigCPtr, this), true);
  }

  public void fromUtf8(String stringUtf8) {
    nelmiscJNI.ucstring_fromUtf8(swigCPtr, this, stringUtf8);
  }

  public static ucstring makeFromUtf8(String stringUtf8) {
    return new ucstring(nelmiscJNI.ucstring_makeFromUtf8(stringUtf8), true);
  }

}
